﻿using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace IService.Entity
{
    public interface IBUserService
    {
        #region Get
        /// <summary>
        /// 查询所有用户（分页）
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public Task<MessageModel<string>> GetAllToPage(int offset, int limit);

        /// <summary>
        /// 查询用户
        /// </summary>
        /// <param name="bUser">用户</param>
        /// <returns></returns>
        public Task<BUser> GetUser(BUser bUser);

        /// <summary>
        /// 查询所有用户
        /// </summary>
        public Task<MessageModel<List<BUser>>> GetAll();

        /// <summary>
        /// 根据条件表达式查询数据列表
        /// </summary>
        /// <param name="whereExpression">条件表达式</param>
        /// <returns>数据列表</returns>
        public Task<MessageModel<List<BUser>>> GetByExpression<BUser>(Expression<Func<BUser, bool>> whereExpression);

        /// <summary>
        /// 查询角色按用户名密码
        /// </summary>
        /// <param name="bUser"></param>
        /// <returns></returns>
        public Task<MessageModel<BUser>> GetByNameAndPwd(string Name,string Pwd);

        /// <summary>
        /// 查询角色按ID
        /// </summary>
        /// <param name="bUser"></param>
        /// <returns></returns>
        public Task<MessageModel<BUser>> GetById(int id);
        #endregion

        #region Post
        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name="bUser"></param>
        /// <returns></returns>
        public Task<MessageModel<string>> Post(BUser bUser);

        #endregion

        #region Put
        /// <summary>
        /// 修改角色
        /// </summary>
        /// <param name="bUser"></param>
        /// <returns></returns>
        public Task<MessageModel<string>> Put(BUser bUser);

        /// <summary>
        /// 重置密码
        /// </summary>
        /// <param name="id">用户ID</param>
        /// <param name="password">密码</param>
        /// <returns></returns>
        public Task<MessageModel<string>> Reset(int id, string password);

        #endregion

        #region Delete
        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name="bUser"></param>
        /// <returns></returns>
        public Task<MessageModel<bool>> DelById(int id);

        #endregion

    }
}
